#ifndef _PANDAX__IMAGE_H__
#define _PANDAX__IMAGE_H__
#include "../utility/px_type.h"
typedef struct _image
{
  char * filename;
  PXUINT8 * data;
  int width;
  int height;
  PXBOOL has_alpha;
  PXUINT8 bits_perComponent;
}PXIMAGE;

#define CC_RGB_PREMULTIPLY_APLHA(vr, vg, vb, va) \
	(unsigned)(((unsigned)((unsigned char)(vr) * ((unsigned char)(va) + 1)) >> 8) | \
	((unsigned)((unsigned char)(vg) * ((unsigned char)(va) + 1) >> 8) << 8) | \
	((unsigned)((unsigned char)(vb) * ((unsigned char)(va) + 1) >> 8) << 16) | \
	((unsigned)(unsigned char)(va) << 24))

PXIMAGE* load_BMP(const char* filename);
PXIMAGE* load_PNG(const char* filename);
#endif // px_image_h__
